1. Technical Field
The present invention relates to a data cache and, in particular, to loading a cache with a new set of data without a preceding flush of current data. Still more particularly, the present invention provides a method, apparatus, and program for loading a cache with new and updated data and with a subsequent purge of stale cache information.
2. Description of Related Art
In a system in which a cache of data is managed by a cache manager, it may become necessary to populate the cache with a new set of data from a master source. However, it may be desirable to keep the current loaded data set active while the cache is populated with new data. The populate may add new data or update existing data. Once the populate is complete and committed, then old data which is not part of the new data set should be purged. For example, if the data set represents a set of security access rules, then flushing the existing data set prior to the populate may open a security exposure window if that rule is reloaded with the new data set.
Therefore, it would be advantageous to maintain the data set until the new populate is completed, which could update existing data and add new data, and to then purge any stale data from the original data set from the cache.
The present invention provides a mechanism for the acquisition of a data set key prior to starting a populate. This key, referred to as the cache epoch, is obtained from cache implementation by the cache manager that is performing the populate. The returned cache epoch is kept in the cache as the new pending epoch value. The cache manager then proceeds to load the cache with the new data set. As the data is added, the cache associates the data with the pending epoch. When the populate is complete, the cache manager commits the acquired pending epoch in the cache and, subsequently, the cache proceeds to purge all data that is not part of the committed epoch.